/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jfonia.view.panels;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.List;
import org.jfonia.connect5.basics.MutableValueNode;
import org.jfonia.view.symbols.ISymbol;

/**
 *
 * @author Rik Bauwens
 */
public class ViewLayerPanel extends BasicNodePanel
{
        private List<ISymbol> symbols;

        public ViewLayerPanel(MutableValueNode<Double> xNode, MutableValueNode<Double> yNode,
                              MutableValueNode<Double> width, MutableValueNode<Double> height)
        {
                super(xNode, yNode, width, height);
                symbols = new ArrayList<ISymbol>();
                setOpaque(false);
        }

        public void addSymbol(ISymbol symbol)
        {
                symbols.add(symbol);
        }

        public void removeSymbol(ISymbol symbol)
        {
                symbols.remove(symbol);
        }

        @Override
        public void paintComponent(Graphics g)
        {
                super.paintComponent(g);
                for(ISymbol symbol : symbols)
                        symbol.paintSymbol((Graphics2D) g);
        }
}
